From c3f205fa5fb1ef272ee95a55230e5c91c410b788 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 17 Oct 2006 15:36:08 +0000 Subject: [PATCH] Don't crash if we attempt -T input on a format that doesn't support it. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2403 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gpsbabel/main.c b/gpsbabel/main.c index 59ff76ff9..b2e36f8bf 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -440,7 +440,15 @@ main(int argc, char *argv[]) */ if (global_opts.masked_objective & POSNDATAMASK) { waypoint *wpt = waypt_new(); - ivecs->position_ops.rd_init(fname); + + if (!ivecs->position_ops.rd_position) { + fatal("Realtime tracking (-T) is not suppored by this input type.\n"); + } + + + if (ivecs->position_ops.rd_init) { + ivecs->position_ops.rd_init(fname); + } if (global_opts.masked_objective & ~POSNDATAMASK) { fatal("Realtime tracking (-T) is exclusive of other modes.\n"); -- 2.30.2